.w-row
  .w-col.w-col-10.w-col-push-1
    = render 'devise/shared/alert'
    .w-form.card.card-terciary.u-marginbottom-20
      .fontsize-base.fontweight-semibold Cartões de crédito
      .fontsize-small.u-marginbottom-20
        ' Caso algum projeto que você tenha apoiado <b>com Cartão de Crédito</b> não seja bem-sucedido, nós efetuaremos o reembolso <b>automaticamente</b> no cartão utilizado para efetuar o apoio.
      .divider.u-marginbottom-20
      .w-row.w-hidden-tiny.card
        .w-col.w-col-5.w-col-small-5
          .fontsize-small.fontweight-semibold Cartão
        .w-col.w-col-5.w-col-small-5
          .fontweight-semibold.fontsize-small Operadora
        .w-col.w-col-2.w-col-small-2
      - resource.credit_cards.each do |credit_card|
        .w-row.card
          .w-col.w-col-5.w-col-small-5
            .fontsize-small.fontweight-semibold 
              | XXXX XXXX XXXX&nbsp;#{credit_card.last_digits}
          .w-col.w-col-5.w-col-small-5
            .fontsize-small.fontweight-semibold.u-marginbottom-10
              = credit_card.card_brand.upcase
          .w-col.w-col-2.w-col-small-2
            = link_to 'Remover', user_credit_card_path(resource, credit_card), class: 'btn btn-terciary btn-small', method: :delete, data: { confirm: 'você tem certeza?' }

    = simple_form_for resource, html: { class: 'w-form', id: 'user_billing_form' } do |f|
      = hidden_field_tag :anchor, 'billing'
      .w-form.card.card-terciary
        = f.simple_fields_for :bank_account do |bform|
          .fontsize-base.fontweight-semibold Dados bancários
          .fontsize-small.u-marginbottom-20
            | Caso algum projeto que você tenha apoiado <b>com Boleto Bancário</b> não seja bem-sucedido, nós efetuaremos o reembolso de seu pagamento <b>automaticamente</b> na conta indicada abaixo.
          .divider.u-marginbottom-20
          .w-row
            .w-col.w-col-6.w-sub-col
              = bform.label :bank_id, class: 'field-label fontweight-semibold force-text-dark'
              = bform.input_field :bank_id, as: :select, collection: Bank.to_collection, class: 'w-select positive'
            .w-col.w-col-6
              .w-row
                .w-col.w-col-6.w-col-small-6.w-col-tiny-6.w-sub-col-middle
                  = bform.label :agency, class: 'field-label fontweight-semibold force-text-dark'
                  = bform.input_field :agency, as: :string, class: 'positive'
                .w-col.w-col-6.w-col-small-6.w-col-tiny-6
                  = bform.label :agency_digit, class: 'field-label fontweight-semibold force-text-dark'
                  = bform.input_field :agency_digit, as: :string, class: 'positive'
          .w-row
            .w-col.w-col-6.w-sub-col
              .w-row
                .w-col.w-col-6.w-col-small-6.w-col-tiny-6.w-sub-col-middle
                  = bform.label :account, class: 'field-label fontweight-semibold force-text-dark'
                  = bform.input_field :account, as: :string, class: 'positive'
                .w-col.w-col-6.w-col-small-6.w-col-tiny-6
                  = bform.label :account_digit, class: 'field-label fontweight-semibold force-text-dark'
                  = bform.input_field :account_digit, as: :string, class: 'positive'
            .w-col.w-col-6
              = bform.label :owner_name, class: 'field-label fontweight-semibold force-text-dark'
              = bform.input_field :owner_name, as: :string, class: 'positive'
          .w-row
            .w-col.w-col-6.w-sub-col
              = bform.label :owner_document, class: 'field-label fontweight-semibold force-text-dark'
              = bform.input_field :owner_document, as: :tel, validation_text: true, class: 'positive', data: { :'validate-cpf-cnpj' => true }
            .w-col.w-col-6

      .u-margintop-30
        .w-container
          .w-row
            .w-col.w-col-4.w-col-push-4
              = f.submit 'Salvar',  class:'btn btn-large'
 

